package com.hexacta.hrs.sandbox.tasks2.data;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.hexacta.hrs.sandbox.tasks2.model.Task;

@SuppressWarnings("unchecked")
public class TaskDaoImpl extends HibernateDaoSupport
		implements TaskDao {

	public List<Task> findAll() {
		return getHibernateTemplate().find("from " + Task.class.getSimpleName());
	}

	public Task findById(Long id) {
		return (Task) getHibernateTemplate().get(Task.class, id);
	}

	public void persistTask(Task task) {
		getHibernateTemplate().saveOrUpdate(task);
		
	}

}
